<%@page import="comits.business.tiers.metiers.Commande"%>
<%@page import="java.util.ArrayList"%>
<%@page import="comits.business.tiers.metiers.LigneCmd"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.ParseException"%>
<%@page import="java.text.ParseException"%>
<%@page import="javax.print.DocFlavor.STRING"%>
<%@page import="java.util.Calendar"%>
<%@page import="comits.web.client.servlets.demo.*"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="d"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1" import="java.sql.*" errorPage=""%>
<!--<sql:setDataSource var="dataSource" driver="com.mysql.jdbc.Driver"
	url="jdbc:mysql://178.33.40.182:3306/comits_base" user="comits"
	password="AdiTheo" scope="session" />	-->
<sql:setDataSource var="dataSource" driver="com.mysql.jdbc.Driver"
	url="jdbc:mysql://localhost:3306/comits_base" user="root"
	password="admin" scope="session" />

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>General Query</title>
<link href="mm_entertainment.css" rel="stylesheet" type="text/css" />
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>

	<table width="100%" border="0" cellspacing="0" cellpadding="0"
		align="center" border>
		<tr bgcolor="02021e">
			<td width="410" nowrap="nowrap"><img src="images/vin.jpg"
				width="400" height="140" border="0" /></td>
			<td colspan="2" valign="center" nowrap="nowrap" id="logo">OENOLOGISTICS</td>
		</tr>
		<tr>
			<td colspan="3" id="dateformat" height="30"><jsp:include
					page="menu.jsp" /><!--&nbsp;&nbsp; &nbsp; <a href="javascript:;">menu.jsp</a>-->
			</td>
		</tr>
		<%
			String datejour = (String) request.getAttribute("datejour");
			java.sql.Date d = new java.sql.Date(DateUtil.stringToDate(datejour).getTime());
			int NumCmd = (Integer) request.getAttribute("numcmd");
			//ArrayList l=(ArrayList) request.getAttribute("listLigneCommande");
			 List<LigneCmd> listlignecmd =(List<LigneCmd>) request.getAttribute("listLigneCommande"); 
			 List<Commande> listcmd=(List<Commande>) request.getAttribute("listcommande");
			%>
		<sql:query var="queryresults" dataSource="${dataSource}">
              select * from comits_base.statutcommande
    </sql:query>
	 <tr>
										
										<td><select name="login">
												<c:forEach var="row" items="${queryresults.rows}"
													varStatus="status">
													<option value="${row.LibelleStatutCmd}">
													</option>
												</c:forEach>
										</select>
										</td> 
		

		
		<tr>
		<tr>
		<td>
		<%for(LigneCmd lignecmd : listlignecmd) {
				%>
			<h1><%=lignecmd.getNumCmd() %></h1>
			<h1><%=lignecmd.getNumPdt()%></h1>			
			<h1><%=lignecmd.getNumlCmd()%></h1>
			<h1><%=lignecmd.getStatut()%></h1>
				<%} %>
		<%-- <% for (int i=0;i<length;i++) {%>
		
		<%} %> --%>
	</td>
		</tr>
		<tr>
		<td>
		<%for(Commande cmd : listcmd) {
				%>
			<h1><%=cmd.getNumCmd() %></h1>
			<h1><%=cmd.getAvisCmd()%></h1>			
			<h1><%=cmd.getExpediteur()%></h1>
			<h1><%=cmd.getDateCreation()%></h1>
				<%} %>
		</td>
		</tr>
		
			<td colspan="3" valign="top"><br />
			</td>
		</tr>
	</table>
</body>
</html>